/**
 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Autogenerated file -- DO NOT EDIT!

#ifndef LIBPANDABASE_TEMPLATES_SOURCE_LANGUAGE_H
#define LIBPANDABASE_TEMPLATES_SOURCE_LANGUAGE_H

namespace ark {

enum class SourceLanguage : uint8_t {
% Common::plugins.each do |plugin_lang, plugin_opts|
    <%= plugin_lang %> = <%= plugin_opts["lang_enum_id"] %>,
%   if plugin_lang == "JAVA"
    JAVA_8 = JAVA,
%   end
% end
    PANDA_ASSEMBLY = 1,
    INVALID = static_cast<uint8_t>(-1)
};

inline std::ostream &operator<<(std::ostream &stream, SourceLanguage lang)
{
    switch (lang) {
% Common::plugins.each do |plugin_lang, plugin_opts|
        case <%= plugin_opts["lang_enum"] %>:
%   name = case plugin_lang
%     when "ECMASCRIPT" then "ECMAScript"
%     when "JAVA_8" then "Java 8"
%     when "JAVA" then "Java"
%     else plugin_lang.gsub(/_/, " ").capitalize
%   end
            stream << "<%= name %>";
            break;
% end
        case ark::SourceLanguage::PANDA_ASSEMBLY:
            stream << "Panda Assembly";
            break;
        default:
            UNREACHABLE();
    }
    return stream;
}

inline bool IsValidSourceLang(SourceLanguage lang) {
    switch (lang) {
% Common::plugins.each do |plugin_lang, plugin_opts|
        case <%= plugin_opts["lang_enum"] %>:
% end
        case ark::SourceLanguage::PANDA_ASSEMBLY:
            return true;
        default:
            return false;
    }
}

} //  namespace ark

#endif  // LIBPANDABASE_TEMPLATES_SOURCE_LANGUAGE_H
